<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="string" uri="http://jakarta.apache.org/taglibs/string-1.1" %>
<%@ taglib uri="/WEB-INF/tlds/pagination.tld" prefix="pagination" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Bettersoft Portal</title>
    <link href="/common/css/indexStyle.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript" src="/common/js/common.js"></script>
    <script type='text/javascript' src="/common/dwr/engine.js"></script>
    <script type='text/javascript' src="/common/dwr/util.js"></script>
    <script type='text/javascript' src='/dwr/interface/BettersoftPortalService.js'></script>

    <script type="text/javascript">
        // Locale 설정을 바꾼다.
        function jsChangeLocale(lan) {
            var TheForm = document.menuFrm;
            TheForm.nextTarget.value = "intro";
            TheForm.action = "${pageContext.request.contextPath}/changeLocale.do?language=" + lan;
            TheForm.submit();
        }

        // Notice Board List 페이지로 이동한다.
        function jsNoticeBoardList() {
            var TheForm = document.menuFrm;
            TheForm.title.value = TheForm.search_title.value;
            TheForm.writer_id.value = TheForm.search_writer.value;
            TheForm.writer_nick_name.value = TheForm.search_nickName.value;
            TheForm.content.value = TheForm.search_content.value;
            TheForm.nextTarget.value = "noticeBoardList";	// page name
            TheForm.action = "./noticeBoardList.do";
            TheForm.submit();
        }

        // Community Board List 페이지로 이동한다.
        function jsCommunityBoardList() {
            var TheForm = document.menuFrm;
            TheForm.nextTarget.value = "communityBoardList";	// page name
            TheForm.action = "./communityBoardList.do";
            TheForm.submit();
        }

        // 정보보기
        function jsMemberContent(memberId) {
            var TheForm = document.frm;
            TheForm.memberId.value = memberId;
            TheForm.nextTarget.value = "memberContent";	// page name
            TheForm.action = "./memberContent.do";
            TheForm.submit();
        }

        // Member List 페이지로 이동한다.
        function jsMemberList() {
            var TheForm = document.menuFrm;
            TheForm.nextTarget.value = "memberList";	// page name
            TheForm.action = "./memberList.do";
            TheForm.submit();
        }


    </script>
</head>
<body>
<!------------------------------ top 시작-------------------------------------->
<%@include file="portalHeader.jsp" %>
<!------------------------------ top 끝-------------------------------------->
<form name="frm" method="POST">
    <input type="hidden" name="nextTarget" value="">
    <input type="hidden" name="currentPage" value="${currentPage}">
    <input type="hidden" name="memberId" value="">
    <div id="wrap">
        <div>
            <table class="tb_board">
                <tr>
                    <td class="board_title01">사진</td>
                    <td class="board_title01">이름</td>
                    <td class="board_title01">직급</td>
                    <td class="board_title01">이메일</td>
                    <td class="board_title01">연락처</td>
                    <td width="200" class="board_title01"></td>
                </tr>
                <c:forEach items="${memberList}" var="memberList" varStatus="serviceStatus" begin="0" end="${totalCount}"
                           step="1">
                    <tr>
                        <td class="board_list01">
                            <c:if test="${memberList.PROFILE_IMAGE_URL != ''}">
                                <a href="javascript:jsMemberContent('${memberList.BETTERSOFT_ID}')" class="btn_small"><img src="/upload/profile/${memberList.PROFILE_IMAGE_URL}" style="width: 120px; height: 120px;"></a>
                            </c:if>
                            <c:if test="${memberList.PROFILE_IMAGE_URL == ''}">
                                <a href="javascript:jsMemberContent('${memberList.BETTERSOFT_ID}')" class="btn_small"><img src="/upload/profile/empty.jpg" style="width: 120px; height: 120px;"></a>
                            </c:if>
                        </td>
                        <td class="board_list01">${memberList.NAME}</td>
                        <td class="board_list01">
                            <c:if test="${memberList.RANK == '1'}">사원</c:if>
                            <c:if test="${memberList.RANK == '2'}">주임</c:if>
                            <c:if test="${memberList.RANK == '3'}">대리</c:if>
                            <c:if test="${memberList.RANK == '4'}">과장</c:if>
                            <c:if test="${memberList.RANK == '5'}">차장</c:if>
                            <c:if test="${memberList.RANK == '6'}">부장</c:if>
                            <c:if test="${memberList.RANK == '7'}">이사</c:if>
                            <c:if test="${memberList.RANK == '8'}">대표</c:if>
                        </td>
                        <td class="board_list01">${memberList.EMAIL}</td>
                        <td class="board_list01">${memberList.PHONE}</td>
                        <td class="board_list02">
                            <a href="javascript:jsMemberContent('${memberList.BETTERSOFT_ID}')" class="btn_small">정보보기</a>
                        </td>
                    </tr>
                </c:forEach>
            </table>
        </div>
        <div class="btn_box">
            <div class="page">
                <pagination:paging>
                    <pagination:function>goListPage</pagination:function> <!-- 자바스크립트 함수 -->
                    <pagination:currentPage>${currentPage}</pagination:currentPage> <!-- 현재페이지 -->
                    <pagination:totalRows>${totalRow}</pagination:totalRows> <!-- 전체글수 -->
                    <pagination:pageSize>${pageSize}</pagination:pageSize> <!-- 페이지당 조회건수 -->
                </pagination:paging>
            </div>
        </div>
    </div>
</form>
<!------------------------------ top 시작-------------------------------------->
<%@include file="portalFooter.jsp" %>
<!------------------------------ top 끝-------------------------------------->
</body>
</html>